var div = document.getElementById('menu');
var home = div.children[0];
var aList = div.getElementsByTagName('a');
var r = 100;
var state=0;
home.onclick=function(e){
	if(state==1)
	{
		//收起菜单
		for(var i=0;i<aList.length;i++)
		{
			aList[i].style.transform="translate("+0+"px,"+0+"px)";
			aList[i].style.transitionDelay=i*200+"ms";
		}
		state--;
	}else{
		//弹出
		var dStep = 360/aList.length;
		for(var i=0;i<aList.length;i++)
		{
			var deg = i*dStep;
			var y =Math.sin(Math.PI/180*deg)*r;
			var x = Math.cos(Math.PI/180*deg)*r;
			aList[i].style.transform="translate("+x+"px,"+y+"px)";
			aList[i].style.transitionDelay=i*200+"ms";
		}
		state++;
	}
}